package edu.study.api.common.constraints;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Created by za-daixiaojun on 2017/11/14.
 */
@Documented
@Constraint(validatedBy = EnumValidator.class)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface IsEnum {

    Class<? extends Enum<?>> value();

    String message() default "非法的枚举值";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
